package com.example.luke.shengdangxiaoattendance.Model;

import android.content.Context;

import com.example.luke.shengdangxiaoattendance.Database.DingHanDB;

import java.util.ArrayList;

/**
 * Created by luke on 6/1/17.
 */

public class StudentAttendance  {

    public static   final String DH_TABLE_NAME = "attendanceList";

    public static   final String  student_class="student_class";//班级编号
    public static   final String  student_name="student_name";//商品编号
    public static   final String  student_employeeCode="student_employeeCode";//商品编号
    public static   final String  student_issueUnit="student_issueUnit";//单位发票名称

    public static   final String  student_gender="student_gender";//商品编号
    public static   final String  student_age="student_age";//商品编号
    public static   final String student_culture="student_culture";//单位发票名称
    public static   final String  student_id="student_id";//商品编号
    public static   final String  student_mission="student_mission";//职务
    public static   final String  student_position="student_position";//职称

    public static   final String  student_contact="student_contact";//职务
    public static   final String  student_email="student_email";//职称
    public static   final String  student_address="student_address";//职务
    public static   final String  student_roomNo="student_roomNo";//职称
    public static   final String  student_remark="student_remark";//职务

    public static   final String  attendance_date="attendance_date";//职称
    public static   final String  attendance_time="attendance_time";//职务

    public static   final String  class_time="class_time";//职务

    public String className;

    public String name;

    public String employeeID;

    public String issueUnit;
    public String gender;
    public String age;
    public String culture;
    public String studentID;

    public String attendanceDate;
    public String attendanceTime;
    public  String classTime;



    private  static  Course course;
    private ArrayList<Course > courseArrayList;

    public  static final String DH_CREATE_TABLE="CREATE TABLE " + DH_TABLE_NAME + "( " + student_class + " TEXT," + student_name + " TEXT,"
            + student_employeeCode + " TEXT," + student_issueUnit + " TEXT," + student_gender + " TEXT,"+ student_age + " TEXT,"
            + attendance_date + " TEXT,"+ student_id + " TEXT,"+ attendance_time + " TEXT,"+ class_time + " TEXT,"+ student_position + " TEXT,"
            + student_contact + " TEXT,"+ student_email + " TEXT,"+ student_address + student_roomNo + " TEXT,"+ " TEXT,"+ student_remark + " TEXT )";

    private Context context;

    public static void clearAllStudent(Context context){
        DingHanDB.getInstance(context).clearAllStudent();

    }

    public static void saveAttendance(Context context, StudentAttendance course){

        DingHanDB.getInstance(context).insert(DH_TABLE_NAME,course);

    }

    public static boolean checkStudentAttend(Context context, String className,String date,String employeeID,String classTime ){

    return     DingHanDB.getInstance(context).checkStudentAttend(className,date,employeeID,classTime);


    }





}
